package com.wenan.ui.controls.standard
{
	import com.wenan.data.DataUtil;
	
	import mx.containers.HBox;
	import mx.controls.Image;
	import mx.controls.Label;
	import mx.core.UIComponent;
	
	import spark.components.HGroup;
	
	public class LegendBox extends HGroup
	{
		private var color:String;
		private var min:int;
		private var max:int;
		
		public function LegendBox(color:String,min:int,max:int)
		{
			super();
			this.color=color;
			this.min=min;
			this.max=max;
			this.gap=2;
			
			var ui:UIComponent=new UIComponent();
			ui.width=28;
			ui.height=16;
			addElement(ui);
			ui.graphics.beginFill(DataUtil.convertColor(color));
			ui.graphics.drawRect(0,0,28,16);
			
			var lbl:Label=new Label();
			if(min<max)
				lbl.text=min+"-"+max+" ( 人 ) ";
			else
				lbl.text=min+" 人以上 ";
			addElement(lbl);
		}
	
	}
}